<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<button id="btn">你好</button>
<script>
var btn = document.getElementById("btn");

//function foo(){
//    console.log("btn....");
//}
//
//btn.addEventListener("click", foo)

/*var foo;
btn.addEventListener("click", foo = function (){
    console.log("abc");
})*/

// 移除事件处理程序的时候, 必须和添加的是同一个函数
btn.removeEventListener("click", foo)

</script>
</body>
</html>